home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d6
/
glazer.arc
/
INVVALUE.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-10-07
|
895b
|
23 lines
100 'Investment Value ("INVVALUE")
110 CLS
120 COLOR 0,15 : PRINT "Investment Value" : COLOR 15,0
130 DEFDBL A-Z
140 MONEYFMT$ = "$$##,###,###.##"
150 PRINT : PRINT
160 PRINT "Do not enter dollar signs or commas"
170 PRINT
180 ' Let user enter data
190 INPUT "Value of investment at end of term: ", FV
200 INPUT "Income each period: ", PMT
210 INPUT "Total number of periods: ", NPERIODS
220 INPUT "Number of income receipts per year: ", NPY
230 INPUT "Annual interest rate (in percent): ", AR
240 ' Find present value of income receipts
250 PR = (1 + AR / 100) ^ (1 / NPY) - 1
260 IF PR <> 0 THEN VALUEINCOME = (PMT / PR) * (1 - (1 + PR) ^ -NPERIODS) ELSE VALUEINCOME = PMT * NPERIODS
270 ' Add value at end of term
280 PV = VALUEINCOME + FV * (1 + PR) ^ -NPERIODS
290 PRINT
300 PRINT "Value of investment: ";USING MONEYFMT$; PV
310 END